package com.voltmao.persistent.mapper;

import org.apache.ibatis.annotations.Param;
import com.voltmao.persistent.model.ProviderUser;
import com.voltmao.persistent.model.ProviderUserCriteria;

import java.util.List;
import java.util.Map;

public interface ProviderUserMapper {
    int countByExample(ProviderUserCriteria example);

    int deleteByExample(ProviderUserCriteria example);

    int deleteByPrimaryKey(String dataId);

    int insert(ProviderUser record);

    int insertSelective(ProviderUser record);

    List<ProviderUser> selectByExample(ProviderUserCriteria example);

    ProviderUser selectByPrimaryKey(String dataId);

    int updateByExampleSelective(@Param("record") ProviderUser record, @Param("example") ProviderUserCriteria example);

    int updateByExample(@Param("record") ProviderUser record, @Param("example") ProviderUserCriteria example);

    int updateByPrimaryKeySelective(ProviderUser record);

    int updateByPrimaryKey(ProviderUser record);

    ProviderUser selectByExampleForOne(ProviderUserCriteria example);

    Map<String, Object> selectMapByPrimaryKey(String dataId);

    Map<String, Object> selectMapByExampleForOne(ProviderUserCriteria example);

    List<Map<String, Object>> selectMapByExample(ProviderUserCriteria example);

    /**
     * 意向渠道登录后，通过登录id获取个人信息
     * @param sysUserId
     * @return
     */
    Map<String, Object> selectBySysUserId(String sysUserId);

    /**
     * 通过provider_user的data_id获取意向渠道信息
     * @param providerUserId
     * @return
     */
    Map<String, Object> getByProviderId(String providerUserId);

    /**
     * 更新绑定的业务员
     * */
    int updateForEmpl(@Param("intentIdArr") List<String> intentIdArr, @Param("emplId") String emplId);

    int deleteOtherInfoBytbNameAndProviderId(Map<String, Object> params);

    /**
     * 更新意向渠道审核状态
     * @param params
     * @return
     */
    int aduitIntent(Map<String, Object> params);

    /**
     * 该渠道商是否在审核状态集合中
     *  true:合同表所对应的渠道商的审核状态在列表中
     * @param providerId ，渠道商主键
     * @param shzts ，可以通过的类型
     * @return
     */
    boolean getAuthByQdshzt(@Param("providerId") String providerId, @Param("shzts") String[] shzts);

    ProviderUser getDataId(@Param("auditId") String auditId);

    /**
     * 查询手机号是否存在
     * @param phoneNo
     * @return
     */
    ProviderUser isPhoneNoOk(@Param("phoneNo") String phoneNo);

    /**
     * 获取渠道信息认证的必填信息
     * @param providerUserId
     * @return
     */
    Map<String, Object> getAuthRequierdInfo(String providerUserId);
}